<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:view encoding="UTF-8" locale="#{sessionBean.localeCode}">
	<h:head>
		<title><ui:insert name="title" /></title>
		<link type="text/css" rel="stylesheet"
			href="#{request.contextPath}/css/styles.css" />
	</h:head>
	<h:body>

		<div class="wrapper">
			<div class="pageHeader">
				<br />

				<table width="100%">
					<tr>
						<td width="80%"><h:form id="languageForm"
								style="margin-left:1em">
								<h:panelGrid columns="3">
									<h:outputText style="font-weight: bold;margin-right:1em;"
										value="#{msgs.language}" />
									<p:selectOneMenu id="languageChoice" styleClass="label"
										value="#{sessionBean.localeCode}"
										onchange="languageForm.submit()">
										<f:selectItems var="item" itemLabel="#{msgs[item]}"
											value="#{sessionBean.countries}" />
										<f:converter converterId="LocaleConverter" />
									</p:selectOneMenu>
									<p:message id="msgForLanguageChoice" for="languageChoice" />
								</h:panelGrid>
							</h:form></td>


						<td width="10%" align="right"><h:outputText
								value="#{request.remoteUser}" style="font-weight: bold;" /></td>

						<td width="10%"><h:form
								style="text-align:right; margin-right:1em">
								<p:commandButton rendered="#{sessionBean.username != 'guest'}"
									value="logout" action="#{sessionBean.logout}" ajax="false" />
							</h:form></td>
					</tr>
				</table>
				<br />
			</div>

			<div class="pageTitle">
				<br />
				<ui:insert name="title" />
				<hr />
			</div>

			<div class="container">
				<ui:insert name="content" />
			</div>
		</div>
		<div class="pageFooter">
			<br />
			<h:outputText value="#{msgs.footerTitle}" />
			<br />
		</div>
		<ui:debug />
	</h:body>
</f:view>
</html>